Skip to content

feat(queries): show result_id in queries list table#126

Merged
eddietejeda merged 5 commits into
mainfrom
feat/queries-list-result-id
Jun 4, 2026
Merged

feat(queries): show result_id in queries list table#126
eddietejeda merged 5 commits into
mainfrom
feat/queries-list-result-id

Conversation

@eddietejeda
Copy link
Copy Markdown
Contributor

@eddietejeda eddietejeda commented Jun 4, 2026

Summary

  • queries list now shows full RESULT_ID and MS (execution time in ms) columns; DURATION_MS was renamed to MS for compactness; SQL truncated to 40 chars
  • queries get detail view now shows database id: when the API returns it — field added to QueryRun struct with `#[serde(default)]` so it surfaces automatically once the backend adds it
  • results list now colors status (green = ready, yellow = pending/processing, red = failed, grey = expired) and will automatically show ROWS, QUERY_RUN_ID, and EXPIRES columns once the API returns those fields

Test plan

  • hotdata queries list — RESULT_ID column shows full ID for completed runs, - for in-flight; MS column shows execution time
  • hotdata queries get <id> — detail view renders correctly; database id: line will appear when API adds the field
  • hotdata queries list --output json — full result_id and database_id fields present in JSON output
  • hotdata results list — status is colored (ready = green); table shows ID, STATUS, CREATED cleanly; extra columns will appear when API returns them
  • hotdata results list --output jsonrow_count, query_run_id, expires_at fields present in JSON output once API returns them

- queries list now shows RESULT_ID column alongside query ID, replacing
  DURATION_MS (still visible in queries get detail view)
- SQL truncation reduced from 60 to 40 chars to fit the wider table
- QueryRun struct gains database_id field (serde default) so the detail
  view will surface it automatically once the API starts returning it
@sentry
Copy link
Copy Markdown

sentry Bot commented Jun 4, 2026

Codecov Report

❌ Patch coverage is 0% with 41 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/results.rs 0.00% 24 Missing ⚠️
src/util.rs 0.00% 9 Missing ⚠️
src/queries.rs 0.00% 8 Missing ⚠️

📢 Thoughts on this report? Let us know!

claude[bot]
claude Bot previously approved these changes Jun 4, 2026
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, focused change. RESULT column wiring is correct — header/row column counts match, database_id uses #[serde(default)] so it degrades gracefully until the backend adds it, and JSON/YAML output is unaffected.

Comment thread src/queries.rs Outdated
claude[bot]
claude Bot previously approved these changes Jun 4, 2026
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. One non-blocking nit left inline regarding the RESULT_ID column matching the PR description (8-char prefix vs full id).

Comment thread src/results.rs
} else {
let has_rows = body.results.iter().any(|r| r.row_count.is_some());
let has_query_run = body.results.iter().any(|r| r.query_run_id.is_some());
let has_expires = body.results.iter().any(|r| r.expires_at.is_some());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this results list enhancement (conditional ROWS/QUERY_RUN_ID/EXPIRES columns, status coloring, three new fields) isn't mentioned in the PR title or description, which are entirely about queries list. The code looks correct — header/row column counts stay in sync across all conditional branches — but consider either documenting these results.rs changes in the description or splitting them into a separate PR for a cleaner history. (not blocking)

Comment thread src/results.rs Outdated
claude[bot]
claude Bot previously approved these changes Jun 4, 2026
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving — only non-blocking nits inline. RESULT_ID column wiring in queries.rs is correct (header/row counts match), database_id degrades gracefully via #[serde(default)], and JSON/YAML output is unaffected. The full-vs-8-char-prefix point is already covered by the existing inline thread.

Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed. Prior feedback addressed: color_status consolidated into src/util.rs, PR description now matches the full RESULT_ID column and documents the results list changes. Conditional column logic in results.rs keeps headers and rows in sync. No blocking issues.

@eddietejeda eddietejeda merged commit af4a090 into main Jun 4, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant